﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Bot.Dynamics365.Model
{
    public class Value
    {
        public string LogicalName { get; set; }
        public string EntitySetName { get; set; }
        public string MetadataId { get; set; }
        public Displayname DisplayName { get; set; }
        public Globaloptionset GlobalOptionSet { get; set; }
        public string Label
        {
            get
            {
                if (DisplayName != null
                    && DisplayName.LocalizedLabels != null
                    && DisplayName.LocalizedLabels.Length > 0)
                {
                    return DisplayName.LocalizedLabels[0].Label;
                }

                return LogicalName;
            }
        }
    }
}
